from openpyxl import load_workbook

class excel():
    def __init__(self,excelpath,sheetname):
        self.excelpath=load_workbook(excelpath)
        self.sheetname=self.excelpath[sheetname]
    def getdata(self):
        datalist=[]
        for line in self.sheetname:
            tmp_list=[]
            tmp_list.append(line[0].value)
            tmp_list.append(line[1].value)
            tmp_list.append(line[2].value)
            tmp_list.append(line[3].value)
            tmp_list.append(line[4].value)
            tmp_list.append(line[5].value)
            tmp_list.append(line[6].value)
            datalist.append(tmp_list)
        datalist.pop(0)
        return datalist

if __name__ == '__main__':
    excelpath="D:\python pojects\Daywu\yuekao\yk.xlsx"
    sheetname="Sheet1"
    dy=excel(excelpath,sheetname)
    print(dy.getdata())